package lesson.c4.sample;

import lesson.c4.DataStore;

public class Student {
	public String name;
	
	public int age;
	
	public String sex;
	
	public Student(){
		this("Anonymous");
	}
	
	public Student(String name){
		this(name, -1, "unknown");
	}
	
	public Student(String name, int age, String sex){
		this.name = name;
		this.age = age;
		this.sex = sex;
	}
	
	public void setScore(Course course, int timestamp, int score){
		DataStore.getInstance().set(this.name + course.name + timestamp, String.valueOf(score));
	}
	
	public int getScore(Course course, int timestamp){
		String score = DataStore.getInstance().get(this.name + course.name + timestamp);
		return Integer.parseInt(score);
	}
}
